package com.atguigu01._this;

/**
 * ClassName: PersonTest
 * Description:
 *
 * @Author liu
 * @Create 2024/10/23 21:59
 * @Version 1.0
 */
public class UerTest {
    public static void main(String[] args) {
        User u1 = new User("tom",23);
    }

}


class User{
    String name;
    int  age;

     public User(){

     }

     public User(String name){
         this();
         this.name = name;
     }

    public User(String name, int age){
         //感觉臃余
         //this.name = name; 改为
        this(name);
         this.age = age;
    }
}